package com.tulingdemo.controller;

import com.tulingdemo.service.UserService;
import com.tulingdemo.util.AsyncUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author tyy
 * @Description TODO
 * @Since 2022/2/26
 */
@RestController
public class IndexController {

    @Autowired
    private UserService userService;

    @Resource
    private UserService userServiceImpl2;

    @Autowired
    private AsyncUtils asyncUtils;

    @RequestMapping("/asynTest")
    public void asynTest() {
        for (int i = 0; i < 10000; i++) {
//            asyncUtils.simpleAsync(i);
            asyncUtils.testMethod(i);
//            asyncUtils.testMethod2(i);
//            asyncUtils.simpleAsync2(i);
//            bigLogService.generateTypeLog(LogTypeEnum.API_KAFKA, "报名3.test", JsonUtils.removeEmptyValues("data")  , Constant.SYSTEM_USER);
//            logService.generateTypeLog(LogTypeEnum.API_KAFKA, "报名3.test", JsonUtils.removeEmptyValues("data")  , Constant.SYSTEM_USER);

        }
    }
    @RequestMapping("/getUserServiceBean")
    public String getUserServiceBean(){
        System.out.println("userService = " + userService);
        System.out.println("UserServiceImpl2 = " + userServiceImpl2);
        return "index";
    }

    @RequestMapping
    public String index(){

        return "index";
    }

}
